//
//  ShowCup.h
//  PlantNanny
//
//  Created by Joueu on 14-12-19.
//
//

#ifndef __PlantNanny__ShowCup__
#define __PlantNanny__ShowCup__

#include "cocos2d.h"
#include "cocos-ext.h"

USING_NS_CC_EXT;
USING_NS_CC;

class ShowCup:public ui::Button{
public:
    static ShowCup* createWithNameAndCap(std::string fileName,int cap);
    bool initWithNameAndCap(std::string fileName, int cap);
    void changeWithNameAndCap(std::string fileName,int cap);
    
    bool initWithTypeAndCap(int type, int cap);
    static ShowCup* createWithTypeAndCap(int type,int cap);
    void changeWithTypeAndCap(int type,int cap);
private:
    Label *m_label;
    Sprite *m_capSpr;
    int m_capacity;
    
    Sprite *cupOprBg;
    
    void bottleClicked(Ref *pSender, ui::Widget::TouchEventType type);
    void starBtnPressed(Ref *pSender,ui::Widget::TouchEventType type);
    void delBtnPressed(Ref *pSender, ui::Widget::TouchEventType type);
    
    bool _moveing;
    
    virtual void onEnter();
    virtual void onExit();
    
    void hideTheOpr(Ref *pSender);
    
    CC_SYNTHESIZE(int, _type, Type);
    CC_SYNTHESIZE(ssize_t, _cellIndex, CellIndex);
};


#endif /* defined(__PlantNanny__ShowCup__) */
